<template>
  <div id='wrap'>
    <h1>props泛型参数</h1>
    <scu8 :user msg="放假30天" @sonEmit="handlesonEmit"></scu8>
    <hr>
    <scu9 v-for="item in userArr" :key="item.id" :user="item"></scu9>
  </div>
</template>

<script lang='ts'>
export default {
  name: 'scu18',
}
</script>

<script lang='ts' setup>
import { ref } from 'vue'
import scu8 from "./component/scu8.vue";
import {type Iuser} from "./component/scu8.vue";
import scu9 from "./component/scu9.vue";
const user=ref<Iuser>({
    name:'小米',
    age:18,
    sex:'女'
})
function handlesonEmit(arg1:number,arg2:string,arg3:{name:string}){
    console.log('子组件触发事件,参数如下');
    console.log('参数1:',arg1);
    console.log('参数2:',arg2);
    console.log('参数3:',arg3);
}
const userArr=ref<Iuser[]>([
    {
        id:1,
        name:'小明',
        age:16,
        sex:'男'
    },
    {
        id:2,
        name:'小红',
        age:18,
        sex:'女'
    },
    {
        id:3,
        name:'小绿',
        age:19,
        sex:'男'
    }
])
</script>

<style scoped lang='scss'>

</style>